package com.smh.a03extendsdemo02;

public class animal {
    private String name;

    public animal() {
    }

    public animal(String name) {
        this.name = name;
    }

    public void eat(){
        System.out.println("eat");
    }
    public void drink(){
        System.out.println("drink");
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    public String toString() {
        return "animal{name = " + name + "}";
    }
}
